home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
United Public Domain Gold 2
/
United Public Domain Gold 2.iso
/
utilities
/
pu295.dms
/
pu295.adf
/
Logging
/
CQWWLog
/
CQWWLOG.BAS
< prev
next >
Wrap
BASIC Source File
|
1988-12-18
|
18KB
|
532 lines
' CQWWLOG.BAS version 1.2
' Copyright © 1986,1987 by Clarke Greene K1JX (NOT FOR COMMERCIAL USE)
' Amiga Version by John Gager K7KB
'
' This Microsoft (tm) BASIC program will build a complete log package
' for the CQ Worldwide DX Contest.
'
' The file containing the log entries must be an ASCII file in the
' following format:
'
' (each band requires a separate log entry file)
'
' TIME CALLSIGN RCV'D REPORT (each log entry must
' be followed by a
' carriage return)
'
' At least one space must be between each field of each log entry. Only
' a changed digit in the TIME field must be present; for example, If
' the contest begins at 1800Z and the first contact is made at 1802Z
' and the second contact is made at 1805Z, then only 5 need be entered
' in the TIME field. IF the third contact is made at 1812 Z, then 12
' should be entered in the TIME field. IF the next contact is made at
' 1812 Z, then no number need be entered in the TIME field (however, be
' sure to enter a space to indicate separation between fields)!
'
' These files will be produced:
'
' <filename>.LOG - this is a complete log ready for printing
' <filename>.DUP - this is a sorted duplicate listing ready for printing
' <filename>.SUM - this is a summary sheet ready for printing
'
'
' Depending on the version of BASIC for your particular machine, the
' CLS (Clear Screen) command must be changed. Consult your own
' computer's BASIC documentation for more information.
'
'
' If compiling (a VERY good idea for several orders of magnitude
' improvement in speed), use O and E switches
'
' This program also uses a prefix library file (DXPREFIX.LIB), which
' MUST be on the same disc (and in the same subdirectory) as this
' program.
'
' Define arrays and variables
'
CLEAR ,80000& : DEFINT a-Z : OPTION BASE 1
DIM ENTRY$(1500), MULT$(175), PFX$(1000), CTRY$(1000), CNT$(1000), WIERDPFX$(50), WIERDCTRY$(50), WIERDCNT$(50), AMBCTRY$(10)
DIM Q(175), ZONE(40)
BLANK$=" " : BL$="" : SLANT$="/" : TRUE=-1
DUPE1$=" - Duplica" : DUPE2$="te QSO -"
'
' Define format strings for printouts
'
LOGFORM$=" \ \ \ \ \ \ \ \ \ \ \ \\ \ #"
DUPFORM$=" \ \ \ \ \ \ \ \ \ \"
SUMFORM$=" \ \ \ \ \ \ \ \ \ \"
FOOTFORM$=" ## ## ## ###"
'
CLS
COLOR 3 : PRINT TAB(26) "CQWW DX Contest Log Processor" : COLOR 1
PRINT : PRINT
'
' Read Prefix table file
'
PRINT TAB(5) "Reading prefix library...";
I=0 ' initialize array subscript
OPEN ":DXPREFIX.LIB" FOR INPUT AS #1
WHILE NOT EOF(1)
I=I+1
INPUT #1, PFX$(I), DUMMY$, CTRY$(I), CNT$(I) ' DUMMT$ is a dummy
' variable FOR DATA not
' used
WEND
CLOSE
TABLESIZE=I ' prefix table length
COLOR 3 : PRINT "Done" : COLOR 1
'
' Get user input
'
PRINT : PRINT TAB(5) "What is the station callsign? ";
INPUT "", MYCALL$ : MYCALL$=UCASE$(MYCALL$)
THISENTRY$=MYCALL$ : IF INSTR(THISENTRY$,SLANT$)>0 THEN GOSUB GetPortPrefix ELSE THISPFX$=LEFT$(THISENTRY$,4)
GOSUB SearchPrefix : IF NOT INLIST THEN GOSUB SearchWierd
MYCTRY$=THISCTRY$ : MYCNT$=THISCNT$ : IF MYCNT$="NA" THEN MYCNTPTS=2 ELSE MYCNTPTS=1
ZoneEntry:
PRINT : PRINT TAB(5) "What is the station's WAZ zone? ";
INPUT "", MYZONE$
IF VAL(MYZONE$)<1 OR VAL(MYZONE$)>40 THEN PRINT CHR$(7);: GOTO ZoneEntry
IF VAL(MYZONE$)<10 AND LEN(MYZONE$)=1 THEN MYZONE$="0"+MYZONE$
PRINT : PRINT TAB(5) "What is the beginning date of the contest ";
COLOR 3 : PRINT"<DD/MM/YY>";:COLOR 1:PRINT"? ";
INPUT "", STARTDATE$
MARK=INSTR(STARTDATE$,"/") : IF MARK=0 THEN MARK=INSTR(STARTDATE$,"-")
STARTDAY=VAL(LEFT$(STARTDATE$,MARK-1))
STARTDATE$=RIGHT$(STARTDATE$,LEN(STARTDATE$)-MARK)
MARK=INSTR(STARTDATE$,"/") : IF MARK=0 THEN MARK=INSTR(STARTDATE$,"-")
MON=VAL(LEFT$(STARTDATE$,MARK-1))
IF MON=10 THEN MON$=" Oct. " : RST$="59" ELSE MON$=" Nov. " : RST$="599"
SENT$=RST$+MYZONE$
yr$=RIGHT$(STARTDATE$,LEN(STARTDATE$)-MARK)
PRINT : PRINT TAB(5) "What is the GMT starting time for the contest? ";
INPUT "", STARTGMT$
PRINT : PRINT TAB(5) "What file is the log extract located in? ";
INPUT "", INFILE$ : GOSUB CheckForFile ' check to see if file is valid
IF INSTR(INFILE$,".")<>0 THEN OUTFILE$=LEFT$(INFILE$,INSTR(INFILE$,".")-1) ELSE OUTFILE$=INFILE$
PRINT : PRINT TAB(5) "What frequency band is the log extract for? ";
INPUT "", BAND$
'
' Build log file
'
CLS
PRINT : PRINT TAB(5) "Duping and counting...";
'
' Clear arrays
'
FOR I=1 TO 1500
ENTRY$(I)=BL$
NEXT I
FOR I=1 TO 175
MULT$(I)=BL$
Q(I)=1
NEXT I
FOR I=1 TO 40
ZONE(I)=0
NEXT I
'
' Initialize variables
'
RAWTOTAL=0 : QSOS=0 : DUPES=0 : CTRYNR=0 : ZONENR=0 : TOTPOINTS=0
PGQSOS=0 : PGZONES=0 : PGCTRY=0 : PGPTS=0
DAY=STARTDAY : PREVIOUSGMT$=STARTGMT$
'
' Open input file and output .LOG file
'
OPEN INFILE$ FOR INPUT AS #1 LEN=5000
OPEN OUTFILE$+".LOG" FOR OUTPUT AS #2 LEN=5000
'
' Input data, process, and enter into output file
'
WHILE NOT EOF(1)
LINE INPUT #1, THISENTRY$ ' read entire line from disc file
IF LEN(THISENTRY$)=0 THEN SkipEntry
WHILE ASC(RIGHT$(THISENTRY$,1))<48 AND LEN(THISENTRY$)>0
THISENTRY$=LEFT$(THISENTRY$,LEN(THISENTRY$)-1) ' strip off trailing
' spaces, etc.
WEND
IF LEN(THISENTRY$)>0 THEN RAWTOTAL=RAWTOTAL+1 ELSE GOTO SkipEntry
'
' Separate received report from THISENTRY$
'
RCVD$=BL$ ' initialize RCVD$ to be null string
WHILE ASC(RIGHT$(THISENTRY$,1))>=48
RCVD$=RIGHT$(THISENTRY$,1)+RCVD$
THISENTRY$=LEFT$(THISENTRY$,LEN(THISENTRY$)-1) ' parse last character
' of string
WEND
IF LEN(RCVD$)<=2 THEN RCVD$=RST$+RCVD$ ' if no RST was typed, append
' standard report
IF LEN(RCVD$)<(LEN(RST$)+2) THEN RCVD$=LEFT$(RCVD$,LEN(RST$))+"0"+RIGHT$(RCVD$,1)
WHILE ASC(RIGHT$(THISENTRY$,1))<48
THISENTRY$=LEFT$(THISENTRY$,LEN(THISENTRY$)-1) ' strip off trailing
' spaces, etc.
WEND
'
' Separate GMT from THISENTRY$
'
WHILE ASC(LEFT$(THISENTRY$,1))<48
THISENTRY$=RIGHT$(THISENTRY$,LEN(THISENTRY$)-1) ' strip off leading
' spaces
WEND
IF INSTR(THISENTRY$,BLANK$)<>0 THEN GMT$=LEFT$(THISENTRY$,INSTR(THISENTRY$,BLANK$)-1) ELSE GMT$=BL$
THISENTRY$=RIGHT$(THISENTRY$,(LEN(THISENTRY$)-LEN(GMT$)))
WHILE LEFT$(THISENTRY$,1)=BLANK$
THISENTRY$=RIGHT$(THISENTRY$,LEN(THISENTRY$)-1) ' strip off leading
' spaces
WEND
'
' Fill in missing time data
'
GMT$=LEFT$(PREVIOUSGMT$,(4-LEN(GMT$)))+GMT$
THEDATE$=BL$ : IF GMT$<PREVIOUSGMT$ THEN DAY=DAY+1 : THEDATE$=STR$(DAY)+MON$
THISENTRY$=UCASE$(THISENTRY$)
'
' Check for dupes
'
DUPE.QSO=NOT TRUE : points=3
FOR J=1 TO QSOS
IF LEN(ENTRY$(J))<>LEN(THISENTRY$) GOTO NextDupe
IF ENTRY$(J)=THISENTRY$ THEN NEWZONE$=DUPE1$ : NEWCTRY$=DUPE2$ : DUPES=DUPES+1 : points=0 : DUPE.QSO=TRUE : J=QSOS
NextDupe: NEXT J
IF DUPE.QSO GOTO WriteEntry ' skip over prefix search if this entry is a dupe
QSOS=QSOS+1 : ENTRY$(QSOS)=THISENTRY$
'
' Determine zone and search zone table for new multiplier
'
NEWZONE$=BL$
THISZONE$=RIGHT$(RCVD$,2)
J=VAL(THISZONE$) : IF J<1 OR J>40 THEN GOSUB BadZone
IF ZONE(J)=0 THEN ZONENR=ZONENR+1 : NEWZONE$="Zone #"+STR$(ZONENR) : PGZONES=PGZONES+1
ZONE(J)=ZONE(J)+1
'
' Determine prefix and search prefix library for contact country and continent
'
IF INSTR(THISENTRY$,SLANT$)>0 THEN GOSUB GetPortPrefix ELSE THISPFX$=LEFT$(THISENTRY$,4)
GOSUB SearchPrefix
IF NOT INLIST THEN
GOSUB SearchWierd
CLS:PRINT:PRINT TAB(5) "Back to duping and counting...";
END IF
IF ASC(THISCTRY$)<48 THEN GOSUB ResolvePrefix ' resolve ambiguous
' prefix
'
' Search multiplier table for new country
'
NEWMULT=TRUE : NEWCTRY$=BL$
FOR J=1 TO CTRYNR
IF MULT$(J)=THISCTRY$ THEN Q(J)=Q(J)+1 : NEWMULT=NOT TRUE : J=CTRYNR
NEXT J
IF NEWMULT THEN CTRYNR=CTRYNR+1 : MULT$(CTRYNR)=THISCTRY$ : NEWCTRY$=THISCTRY$+" #"+STR$(CTRYNR) : PGCTRY=PGCTRY+1
'
' Determine point value for QSO
'
IF THISCTRY$=MYCTRY$ THEN points=0 : GOTO UpdatePage
' contacts in your own
' country are worth 0
' points
IF THISCNT$=MYCNT$ THEN points=MYCNTPTS
'
' Update page totals
'
UpdatePage:
PGQSOS=PGQSOS+1 : PGPTS=PGPTS+points
TOTPOINTS=TOTPOINTS+points
'
' Write entry to file
'
WriteEntry:
IF (RAWTOTAL-1) MOD 50=0 THEN GOSUB PrintHeader ' print header if this
' is the beginning of
' a page
PRINT #2, USING LOGFORM$; THEDATE$; GMT$; THISENTRY$; SENT$; RCVD$; NEWZONE$; NEWCTRY$; points
IF RAWTOTAL MOD 50=0 THEN GOSUB PrintFooter ' print footer if this is the
' END of a page
PREVIOUSGMT$=GMT$ : GMT$=BL$
SkipEntry:
WEND
GOSUB PrintFooter
IF RAWTOTAL MOD 50<>0 THEN PRINT#2, CHR$(12) ' if form feed hasn't been
' printed, PRINT one now
CLOSE
COLOR 3 : PRINT "Done" : COLOR 1
'
' Build dupe sheet
'
PRINT : PRINT TAB(5) "Preparing dupe sheet...";
'
' Sort callsigns for dupe sheet
'
M=QSOS\2
WHILE M>0
FOR I=M+1 TO QSOS
J=I-M
WHILE J>0
IF ENTRY$(J)>ENTRY$(J+M) THEN SWAP ENTRY$(J),ENTRY$(J+M) : J=J-M ELSE J=0
WEND
NEXT I
M=M\2
WEND
'
' Enter dupe sheet into file
'
OPEN OUTFILE$+".DUP" FOR OUTPUT AS #1
IF QSOS MOD 250=0 THEN LASTPAGE=QSOS\250 ELSE LASTPAGE=QSOS\250+1
FOR page=1 TO LASTPAGE
PRINT #1, SPC(20-(LEN(MYCALL$)+LEN(BAND$))/2); MYCALL$; " -- Dupe Sheet for ";
PRINT #1, BAND$; " MHz Band -- Page"; STR$(page)
PRINT #1, BL$ : PRINT #1, BL$
FOR ROW=1 TO 50
E=(page-1)*250+ROW
PRINT #1, USING DUPFORM$; ENTRY$(E); ENTRY$(E+50); ENTRY$(E+100); ENTRY$(E+150); ENTRY$(E+200)
NEXT ROW
PRINT #1, CHR$(12) ' go to next page
NEXT page
CLOSE
COLOR 3 : PRINT "Done" : COLOR 1
'
' Build summary listing
'
PRINT : PRINT TAB(5) "Preparing summary sheet...";
'
' Sort countries for summary sheet
'
M=CTRYNR\2
WHILE M>0
FOR I=M+1 TO CTRYNR
J=I-M
WHILE J>0
IF MULT$(J)>MULT$(J+M) THEN SWAP MULT$(J),MULT$(J+M) : SWAP Q(J),Q(J+M) : J=J-M ELSE J=0
WEND
NEXT I
M=M\2
WEND
'
' Append number of qsos per country onto country prefixes
'
FOR I=1 TO CTRYNR
MULT$(I)=MULT$(I)+SPACE$(6-LEN(MULT$(I)))+" -"+STR$(Q(I))
NEXT I
'
' Enter country listing into file
OPEN OUTFILE$+".SUM" FOR OUTPUT AS #1
PRINT #1, SPC(12-(LEN(MYCALL$)+LEN(BAND$))/2); MYCALL$; " -- Summary Sheet for "; BAND$;
PRINT #1, " MHz Band - "; yr$; " CQWW DX Contest"
PRINT #1, BL$
PRINT #1, TAB(15); "Country Listing and number of contacts per Country"
PRINT #1, BL$ : PRINT #1, BL$
IF CTRYNR MOD 5=0 THEN LASTROW=CTRYNR\5 ELSE LASTROW=CTRYNR\5+1
FOR ROW=1 TO LASTROW
PRINT #1, USING SUMFORM$; MULT$(ROW); MULT$(ROW+LASTROW); MULT$(ROW+LASTROW*2); MULT$(ROW+LASTROW*3); MULT$(ROW+LASTROW*4)
NEXT ROW
'
' Build listing of zones worked and contacts per zone
'
J=0
FOR I=1 TO 40
IF ZONE(I)>0 THEN J=J+1 : MULT$(J)="Zone"+STR$(I)+" -"+STR$(ZONE(I))
NEXT I ' put zone count into array
FOR I=J TO 40
MULT$(I)=BL$
NEXT I ' blank out remainder of array
'
' Enter zone listing
'
PRINT #1, BL$
PRINT #1, TAB(18); "Zone Listing and number of contacts per Zone"
PRINT #1, BL$
IF ZONENR MOD 5=0 THEN LASTROW=ZONENR\5 ELSE LASTROW=ZONENR\5+1
FOR ROW=1 TO LASTROW
PRINT #1, USING SUMFORM$; MULT$(ROW); MULT$(ROW+LASTROW); MULT$(ROW+LASTROW*2); MULT$(ROW+LASTROW*3); MULT$(ROW+LASTROW*4)
NEXT ROW
'
' Enter summary into file
'
PRINT #1, BL$ : PRINT #1, BL$
PRINT #1, " Total Valid QSOs - "; STR$(QSOS); " Dupes - "; STR$(DUPES)
PRINT #1, " QSO points - "; STR$(TOTPOINTS)
PRINT #1, " Zones - "; STR$(ZONENR)
PRINT #1, " Countries - "; STR$(CTRYNR)
CLOSE
COLOR 3 : PRINT "Done" : COLOR 1
'
' Print results
'
CLS : PRINT CHR$(7)
PRINT : PRINT TAB(5) "Results for the "; BAND$; " MHz band":PRINT
PRINT TAB(8) "Valid QSOs:";:COLOR 3:PRINT USING" ####";QSOS:COLOR 1
PRINT TAB(8) "Duplicate QSOs:";:COLOR 3:PRINT USING" ##";DUPES:COLOR 1
PRINT TAB(8) "QSO points:";:COLOR 3:PRINT USING" ######,";TOTPOINTS:COLOR 1
PRINT TAB(8) "Zones:";:COLOR 3:PRINT USING" ##";ZONENR:COLOR 1
PRINT TAB(8) "Countries:";:COLOR 3:PRINT USING" ###";CTRYNR:COLOR 1
PRINT : PRINT : PRINT
PRINT TAB(5) "Type ";:COLOR 3:PRINT"C";:COLOR 1
PRINT" to continue with another band,"
PRINT TAB(5) "or any other key to Exit";
ANS$=INPUT$(1)
IF UCASE$(ANS$)="C" THEN CLS : GOTO GetLog ELSE CLS : END
'
' Subroutine to trap missing file
'
CheckForFile:
ON ERROR GOTO Nofile
OPEN INFILE$ FOR INPUT AS #1 ' try opening file
ON ERROR GOTO 0
CLOSE
RETURN
Nofile:
PRINT CHR$(7) : PRINT TAB(4) "That file does not exist - type X to Exit or any other key to continue ";
ANS$=INPUT$(1) : IF ANS$="X" OR ANS$="x" THEN CLS : SYSTEM
PRINT
RESUME GetLog
'
' Subroutine to clear up impossible zone number
'
BadZone:
CLS
PRINT CHR$(7) : PRINT
PRINT TAB(5) "The zone for ";:COLOR 3:PRINT THISENTRY$;
PRINT" ["; THISZONE$; "]";:COLOR 1:PRINT" must be incorrect."
PRINT : PRINT TAB(8) "What is the correct zone number? ";
INPUT "", THISZONE$ : J=VAL(THISZONE$)
IF J<1 OR J>40 GOTO BadZone
CLS:PRINT : PRINT TAB(5) "Back to duping and counting...";
RETURN
'
' Subroutine to determine prefix from portable designator
'
GetPortPrefix:
MARK=INSTR(THISENTRY$,SLANT$)
IF MARK>3 THEN THISPFX$=RIGHT$(THISENTRY$,LEN(THISENTRY$)-MARK) ELSE THISPFX$=LEFT$(THISENTRY$,MARK-1)
IF LEN(THISPFX$)>1 GOTO ReturnPfx ' have prefix - return
IF ASC(THISPFX$)>58 OR ASC(THISPFX$)<47 THEN THISPFX$=LEFT$(THISENTRY$,4) : GOTO ReturnPfx ' (local portable designator)
K=2 ' find position of first numeral in call
WHILE (ASC(MID$(THISENTRY$,K,1))>57 OR ASC(MID$(THISENTRY$,K,1))<48) AND K<LEN(THISENTRY$)
K=K+1
WEND
THISPFX$=LEFT$(THISENTRY$,K-1)+THISPFX$ ' new prefix = portable number
' in old prefix
ReturnPfx:
RETURN
'
' Subroutine to search prefix library for standard country prefix
' AND continent
'
SearchPrefix:
K=4 : INLIST=NOT TRUE : SAVEDPFX$=THISPFX$
WHILE K>0 AND INLIST=NOT TRUE
THISPFX$=LEFT$(THISPFX$,K)
LOW=1 : HIGH=TABLESIZE : INLIST=NOT TRUE ' initial values for
' binary sort
WHILE LOW<=HIGH AND INLIST=NOT TRUE
L=(LOW+HIGH)\2
IF THISPFX$=PFX$(L) THEN INLIST=TRUE : THISCTRY$=CTRY$(L) : THISCNT$=CNT$(L)
IF THISPFX$<PFX$(L) THEN HIGH=L-1 ELSE LOW=L+1
WEND
K=K-1
WEND
RETURN
'
' Subroutine to search unusual prefix list
'
SearchWierd:
IF NRWIERDPFX=0 GOTO GetPrefix ' if the supplementary prefix list is
' empty, skip ahead
K=4
WHILE K>0
SAVEDPFX$=LEFT$(SAVEDPFX$,K)
FOR J=1 TO NRWIERDPFX
IF SAVEDPFX$=WIERDPFX$(J) THEN INLIST=TRUE : THISCTRY$=WIERDCTRY$(J) : THISCNT$=WIERDCNT$(J) : J=NRWIERDPFX : K=1
NEXT J
K=K-1
WEND
IF INLIST THEN RETURN ' if the prefix was found, return
'
' Routine to get prefix definition and continent from user for
' prefix NOT found in LIBRARY
'
GetPrefix:
CLS:PRINT CHR$(7) : PRINT
PRINT TAB(5) "The prefix for ";:COLOR 3:PRINT THISENTRY$;
COLOR 1:PRINT " can't be found in the prefix library."
PRINT : PRINT TAB(8) "What is the callsign prefix? ";
INPUT "", HELDPFX$:HELDPFX$=UCASE$(HELDPFX$)
PRINT : PRINT TAB(8) "What standard prefix is that equivalent to? ";
INPUT "", THISPFX$:THISPFX$=UCASE$(THISPFX$)
GOSUB SearchPrefix : IF NOT INLIST GOTO GetPrefix
NRWIERDPFX=NRWIERDPFX+1 : WIERDPFX$(NRWIERDPFX)=HELDPFX$
WIERDCTRY$(NRWIERDPFX)=THISCTRY$ : WIERDCNT$(NRWIERDPFX)=THISCNT$
PRINT
RETURN
'
' Subroutine to resolve ambiguous prefix with user interaction
'
ResolvePrefix:
THISCTRY$=RIGHT$(THISCTRY$,LEN(THISCTRY$)-1) ' strip initial delimiter
J=0
WHILE LEN(THISCTRY$)>0
J=J+1
MARK=INSTR(THISCTRY$,".")
AMBCTRY$(J)=LEFT$(THISCTRY$,MARK-1) ' put multipiler name into array
THISCTRY$=RIGHT$(THISCTRY$,LEN(THISCTRY$)-MARK)
WEND
CLS : PRINT CHR$(7) : PRINT
PRINT TAB(5) "The prefix for ";:COLOR 3 : PRINT THISENTRY$;
COLOR 1 : PRINT" could indicate several different countries."
PRINT : PRINT TAB(8) "The possiblities are:" : COLOR 3 : PRINT
FOR K=1 TO J
PRINT TAB(11) STR$(K); ". "; AMBCTRY$(K) ' print choices to screen
NEXT K
COLOR 1
EnterCountry:
PRINT : PRINT TAB(8) "Type the number of the correct country. > ";
INPUT "", CHOICE$
K=VAL(CHOICE$) : IF K > J OR K < 1 THEN PRINT CHR$(7); : GOTO EnterCountry
THISCTRY$=AMBCTRY$(K)
CLS : PRINT : PRINT TAB(5) "Back to duping and counting...";
RETURN
'
' Subroutine to print log sheet header
'
PrintHeader:
PRINT #2, " "; MYCALL$; " "; BAND$; " MHz Log"; TAB(72); "Page"; STR$(RAWTOTAL\50+1)
PRINT #2, " Date Time Callsign Sent Rcvd New Zone New Country Pt."
PRINT #2, " "; STRING$(78,45)
THEDATE$=STR$(DAY)+MON$
RETURN
'
' Subroutine to print log sheet footer
'
PrintFooter:
IF RAWTOTAL MOD 50=0 GOTO PrintTotals ' if at the end of a page, jump ahead
FOR J=1 TO 50-(RAWTOTAL MOD 50)
PRINT #2, BL$
NEXT J ' fill last page with blank lines
PrintTotals:
PRINT #2, " "; STRING$(78,45)
PRINT #2, " Totals for this page: Valid QSOs - ";
PRINT #2, USING FOOTFORM$; PGQSOS; PGZONES; PGCTRY; PGPTS
PRINT #2, CHR$(12)
PGQSOS=0 : PGZONES=0 : PGCTRY=0 : PGPTS=0 ' reset page counts
RETURN